package local.util;

import java.util.*;

public class MyDateFormat {

    // 01-Sep-02 --> 2002-09-01
    public static String format1(String in_f1) {

	String date  = null;
	String month = null;
	String year  = null;
	String return_string = null;
	StringTokenizer stk = new StringTokenizer(in_f1, "-");

	while (stk.hasMoreTokens()) {
	    date = stk.nextToken();
	    month = stk.nextToken();
	    year = stk.nextToken();
	}

	if (month.startsWith("Jan")) {
	    month = "01";
	}
	if (month.startsWith("Feb")) {
	    month = "02";
	}
	if (month.startsWith("Mar")) {
	    month = "03";
	}
	if (month.startsWith("Apr")) {
	    month = "04";
	}
	if (month.startsWith("May")) {
	    month = "05";
	}
	if (month.startsWith("Jun")) {
	    month = "06";
	}
	if (month.startsWith("Jul")) {
	    month = "07";
	}
	if (month.startsWith("Aug")) {
	    month = "08";
	}
	if (month.startsWith("Sep")) {
	    month = "09";
	}
	if (month.startsWith("Oct")) {
	    month = "10";
	}
	if (month.startsWith("Nov")) {
	    month = "11";
	}
	if (month.startsWith("Dec")) {
	    month = "12";
	}

	if (date.length()==1) {
	    date = "0"+date;
	}

	if (year.length()==2) {
	    year = "20"+ year;
	}

	return_string =  year+"-"+month+"-"+date;
	//System.out.println(return_string);
	return return_string;
    }
}





